package biz

import (
	"context"
	"github.com/go-kratos/kratos/v2/log"
	"gorm.io/gorm"
	"phm/models/generator/model"
)

type SysParameterRepo interface {
	CreateSysParameter(ctx context.Context, uModel *model.SysParameter, db *gorm.DB) error
	UpdateSysParameter(ctx context.Context, uModel *model.SysParameter, db *gorm.DB) error
	DeleteSysParameterByIds(ctx context.Context, ids []string, db *gorm.DB) error
	GetSysParameterById(ctx context.Context, id string) (*model.SysParameter, error)
	GetSysParameterByIds(ctx context.Context, ids []string) ([]*model.SysParameter, error)
	GetSysParameterList(ctx context.Context, query string, pageNum, pageSize int64) ([]*model.SysParameter, int64, error)
	// GetDB 得到db以方便事务处理
	GetDB() *gorm.DB
}

type SysParameterUseCase struct {
	sysParameter SysParameterRepo
	log          *log.Helper
}

func NewSysParameterUseCase(sysParameter SysParameterRepo, logger log.Logger) *SysParameterUseCase {
	return &SysParameterUseCase{
		sysParameter: sysParameter,
		log:          log.NewHelper(logger),
	}
}
